import java.util.Scanner;

public class Test {
    //求一个偶数最近的两个素数
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while(scanner.hasNext()){
            int n = scanner.nextInt();
            int half = n/2;
            for (int i = half; i > 0 ; i++) {
                if(isE(i) && isE(n-i)){
                    System.out.println(i);
                    System.out.println(n-i);
                    break;
                }
            }
        }
    }
    public static boolean isE(int m){
        for (int i = 2; i*i <= m; i++) {
            if(m%i == 0){
                return false;
            }
        }
        return true;
    }
}
